import type {App} from "vue";
import type {AxiosRequestConfig} from "axios";
import { VCairnService } from './vcc/VCairnService';
import { EventDispatcher } from "./core/EventDispatcher";
import vCairnRequest, {useRequest} from "./async/request";

export { VCairnCommand } from './vcc/VCairnCommand';
export { VCairnController } from './vcc/VCairnController';
export { VCairnSeqCommand } from './vcc/VCairnSeqCommand';
export { VCairnEvent } from './vcc/VCairnEvent';
export { VueCairnController } from './vue/VueCairnController';
export { VCairnConnector } from './vcc/VCairnConnector';
export { VCairnService };
export type { AxiosRequestConfig, AxiosResponse } from 'axios';
export type {
    HasErrorInSuccess,
    ErrorInSuccessHandler,
    DefaultErrorHandler,
    ErrorCodeHandleItem,
    VCairnConfig
} from './async/request';
export { useRequest };


const eventBus = EventDispatcher.getInstance();

const VCairn = {
    install(app: App, options: AxiosRequestConfig) {
        VCairnService.defaults = options;
    }
}


export { VCairn, vCairnRequest, eventBus };